<?php defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * @author  Tran Van Thanh
 * @email   thanhtran@vietnambiz.com
 * @date    06.09.2011
 */
 
class Tableprice_model extends MY_Model {
    
    function __construct()
    {
        parent::__construct();
        $this->_table = 'table_price';
    }
    
    function get_articles($page = 1)
    {
    	$this->db->order_by('id DESC');
    	$limit = $this->config->item('table_price', 'limit');
    	return $this->limit($limit, ($page - 1)*$limit)->get_all();
    }

    function delete_articles($articles_id)
    {    	
    	if(is_numeric($articles_id)) {
        	$a[] = $articles_id;
        	$articles_id = $a;
        }    	
    	$this->db->where_in('id', $articles_id)->delete('table_price');
    	$this->delete_many($articles_id);
    }
}